[Experiment] How I currently generate this site
This is how I currently generate this site
#!/bin/sh
intro='<!doctype html>
<html lang="en">
<title>adi</title>
<style>
body {
margin: 0 auto;
max-width: 800px;
font-family: serif;
}
code {
font-family: monospace;
}
</style>
<body>
<a href="index.html">
<img src="data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMA
AA7EAAAOxAGVKw4bAAAAB3RJTUUH4gocCRIWRNYeogAAB5xJREFUeNrtnHlsFFUcxz9dSmlpuYSWU8UD
UCJyCEYUvKLg8QcgBpWIRkFNjEFQoxGPiHhg0HgricR4oWIgcsgl3iiIQFJEE0BBg0gFFAGhlLaw/vG+
G4fNzOw11+J+k0mzuzNv3nznvd/7/o5XKKCAAgoooIACCshLNPG4vTKgBGiIyPOVA0XA4Xx4Gb2Ar4HV
wOVA0xD7UgpcB/wALAA6Rp28IuBDIK6jFpgMdAihLycDz2kWJPrzQtQJbAcst3Q4DhwBPgUuDLAfVwGr
kvoR18uNNCptCEwcfwJ3+Xz/YmAqsNehD3lFYK1GX/JDzACO8+HeVbJzyfert0zjvCJwkcM0imuBOcdD
u3sZsMHhXouBlX4TGPOhzW3A6w6/9QfmAfdppcwWrYEngfeBHja/1wPvAb/ni560jsDpwAnAZoeREZcu
mwN0zeJefYBlLm3HgXWa2nPycQQCbAUWugjYmFbMj/U3JgHeHKgAWuio0HclOucWmYhLXO7dKOJ2apr7
vnr5oQkBZgLXaCQ4oRvwFjAb2A2cKknUXL8f0Cq+BegCjEjDe6oB3g5q6hX72PYqYCkwJg1360YP7/sO
8EtQBMZ8bn+yZE1QqAMmBWn8/SZws1bKoHBH0Kun3wRWBjwCK4CWxwqBp0uLBTkqnpHH0ymfF5FGraRv
STgHiSbASKAVMFwuZd6NwCqNhKDJsz7TEOApTem8G4GXBdHxNHBbvgrpKJCHvJe8X4WPeXhFYMKJjyri
USewimgnbjql8MlDJbAIGACcFGEC+2GyhpEksB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acHkXOzCEEbf7KQ+lIrE
KerPcI81cNaYoMBmpYMcOhf4IwQCt2Cf4CoGjpfZGU0eYII0WNAEHsTUUgfmx/qBCkwqMYxMXQkmtJ/X
BJYrEhNG6UiRJEqmWrRYU79ZFAgsJbwioyIJ8LIMrukn7bkAs/Xicj89kXTbLSY8lGZw/7bySLpbvusm
mVYd1gg8TADVoS5oyOD+/ZPIS8QWz09H6vhFYL1WwzCQ2GJ7IM3znVzFdunw4xeBtQpLxUMkMd0p3Mrl
GeJhEbgX+B4T6AxjERmmBWE4qSPdTrninSGbIYbKB40TblDhNaBzipCX3bXDwvZEmioqE4/AscYhvDbG
4fzfgbOi4M5dS+Z5D7+OvYrSJNAXE+K3O/cz7JNToWBZQAQdTvNl7QK+cjm3EXgkSkGFKuxztV4fSzGh
+o05trM1hc0MBReRe3LI7ajGlHwA9MZsuM62rXFRDW9dhMmXeE3eepFmRQtMkDfTtqYS8b0zPTGJHa/I
m4/7zswhmABrQ4p2DgCPE9Duplwx3qOV+SCm7iYVyjCFS0uAnzFVDfWYKomNmLK6obmo9iDRG1Mj41WZ
2W+YLRYb0zi3BPNPLdor5lcnk7KRPMI0H2zgnWE+UNAG80Qf2uzwfyJwhQ9trud/hLbA52lMyxmY/G6q
82Ziv5XimEYl5h+H2UmL5ZIeZYrTjdAIs5Mdd7vE8gKNnYWFRDV/Z4W91kpa2KEdJvFTIV1XTQEFFFBA
7vgXdvztEFK+WpUAAAAASUVORK5CYII=" alt="blkcat">
</a>
<header>
<h1>Hey, this is adi</h1>
<p>
<a href="mailto:adiscourier@gmail.com" title="E-mail">
drop me an e-mail
</a>
<br> <a href="https://twitter.com/chirpingadi" title="Twitter">
follow me
</a>
<br>
<a href="https://bitbucket.org/adrianemilgrigore">read my code</a>
</p>
</header>
<main>
'
outro='
</main>
<footer>
<h2>built with</h2>
<a href="http://man.openbsd.org/sh">
<code>sh(1)</code>
</a>
<a href="https://github.com/Gottox/smu/">
<code>smu(1)</code>
</a>
<a href="https://git.codemadness.org/stagit/">
<code>stagit(1)</code>
</a>
<a href="https://github.com/peterhellberg/neocities">
<code>neocities</code>
</a>
</footer>
'
cat << INDEX > index.html
$intro
<h2>I wrote</h2>
<ul>
$(
for src in *
do
test -d "$src" && continue
case "$src" in
(LICENSE|README|README.md|*.html)
continue ;;
esac
cat << LI
<li>
<a href="$src.html">
$src
</a>
</li>
LI
cat << ARTICLE > "$src".html
$intro
<article>
$(smu "$src")
</article>
<a href="index.html">back</a>
$outro
ARTICLE
done
)
</ul>
$outro
INDEX
ls -1 ./*.html
Directory contents are
$ ls -1
2018-09-30 Customize ssh-askpass(1)'s appearance
2018-09-31 Terminus Font on the OpenBSD console
LICENSE
README
[Experiment] How I currently generate this site
Script is run as
$ mksite
The assumption is that all files are Markdown
and are intended to be
included in the site. To iterate, the idea is "generate a site out of all the
files in this directory".
Directories are ignored.
I intend to leave the templates hard coded.